# -*- coding: utf-8 -*-
import wsgiref.handlers

from google.appengine.ext import webapp
import sys, time, uuid
import os
from google.appengine.ext.webapp import template
class MainPage(webapp.RequestHandler):
    def get(self):
        u1=uuid.uuid1()
        template_values = {
            'uuid1_int': u1.int,
            'uuid1_hex': u1.int,
            'uuid1_urn': u1.urn
        }
        
        path = os.path.join(os.path.dirname(__file__), 'uuid.html')
        self.response.out.write(template.render(path, template_values))
        
    def post(self):        
        pass
        

def main():
  application = webapp.WSGIApplication(
                                       [('/', MainPage)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == "__main__":
  main()